﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DAL
{
    using DAL.Entities;

    public class DangnhapDAL : BaseDAL, UTL.IBaseDAL 
    {
        public int Count()
        {
            throw new NotImplementedException();
        }

        public DataTable Select()
        {
            throw new NotImplementedException();
        }

        public DataTable Select(object obj)
        {
            throw new NotImplementedException();
        }

        public object GetByKey(object key)
        {
            throw new NotImplementedException();
        }

        public bool Delete(string id)
        {
            throw new NotImplementedException();
        }

        public bool Insert(object obj)
        {
            throw new NotImplementedException();
        }

        public bool Update(object obj)
        {
            throw new NotImplementedException();
        }

        public DataTable Search(string name)
        {
            throw new NotImplementedException();
        }

        public bool deleteobj(object obj)
        {
            throw new NotImplementedException();
        }
        public Boolean kiemtradangnhap(object obj)
        {
            var o = (dangnhap)obj;
            string sql = @"select * from nhanvien where taikhoan='{0}' collate Latin1_General_CS_AS and matkhau='{1}' collate Latin1_General_CS_AS";
            sql = string.Format(sql,o.taikhoan.ToString(),o.matkhau.ToString());
            DataTable dt = ExecuteQuery(sql);
            return dt.Rows.Count > 0 ? true : false;
        }
    }
}
